package ch05.demo.service.impl;

import ch05.demo.dao.UserDao;
import ch05.demo.dao.impl.UserDaoImpl;
import ch05.demo.entity.User;
import ch05.demo.service.UserService;
import ch07.demo.cn.cvs.dao.sysUser.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
@Service("userService")
public class UserServiceImpl implements UserService {
    //    @Resource(name="userDao")
  // @Autowired
    @Resource(type = UserDaoImpl.class)
    private UserDao dao;
    @Autowired
private SysUserMapper sysUserMapper;
    public UserServiceImpl() {
    }

    public UserServiceImpl(UserDao dao) {
        this.dao = dao;
    }

    /**
     * 保存用户
     */
    public void save(User user) {
        dao.save(user);
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }

}
